package com.zbkj.admin.controller.platform.community;

import com.zbkj.common.model.community.CommunityRecommenderSettlement;
import com.zbkj.common.page.CommonPage;
import com.zbkj.common.request.CommunityRecommenderSettlementSearchRequest;
import com.zbkj.common.request.PageParamRequest;
import com.zbkj.common.result.CommonResult;
import com.zbkj.service.community.CommunityRecommenderSettlementService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;


/**
 * 种草官结算单表 前端控制器
 */
@Slf4j
@RestController
@RequestMapping("api/community-recommender-settlement")
@Api(tags = "种草官结算单表") //配合swagger使用

public class CommunityRecommenderSettlementController {

    @Autowired
    private CommunityRecommenderSettlementService communityRecommenderSettlementService;

    /**
     * 分页显示种草官结算单表
     * @param request 搜索条件
     * @param pageParamRequest 分页参数
     * @author keNan
     * @since 2025-06-26
     */
    @ApiOperation(value = "分页列表") //配合swagger使用
    @RequestMapping(value = "/list", method = RequestMethod.GET)
    public CommonResult<CommonPage<CommunityRecommenderSettlement>>  getList(@Validated CommunityRecommenderSettlementSearchRequest request, @Validated PageParamRequest pageParamRequest) {
        CommonPage<CommunityRecommenderSettlement> communityRecommenderSettlementCommonPage = CommonPage.restPage(communityRecommenderSettlementService.getList(request, pageParamRequest));
        return CommonResult.success(communityRecommenderSettlementCommonPage);
    }

    /**
     * 查询种草官结算单表信息
     * @param id Integer
     * @author keNan
     * @since 2025-06-26
     */
    @ApiOperation(value = "详情")
    @RequestMapping(value = "/info", method = RequestMethod.GET)
    public CommonResult<CommunityRecommenderSettlement> info(@RequestParam(value = "id") Integer id) {
        CommunityRecommenderSettlement communityRecommenderSettlement = communityRecommenderSettlementService.getById(id);
        return CommonResult.success(communityRecommenderSettlement);
    }
}



